<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      
      const str = 'The fat cat sat on the MAT.'
      // 修饰符
      //  g    global 全局匹配
      //  i    ignore 忽略大小写
      const reg = /at/gi
      // console.dir(reg)
      // console.log(typeof reg)

      const str2 = str.replace(reg, '**')
      console.log(str2)
    </script>
  </body>
</html>
